import request from '@/utils/request'

const api_name='/supplier'

//这是一个axios请求
export default{


    //搜索功能的接口，向数据库分页查询
    search(searchMap){
      return request({
            url: `${api_name}/list`,
            method: 'post',
            data:searchMap
      })
    },

    //新增和修改的接口，向数据库新增或修改数据
    save(pojo){
      return request({
        url: `${api_name}/add`,
        method: 'post',
        data:pojo
     })
    },
    find(id){
      return request({
        url: `${api_name}/find?id=`+id,
        method: 'get'
      }) 
    },
    update(pojo){
      //修改操作
      return request({
        url: `${api_name}/update`,
        method: 'post',
        data:pojo
     })

    },
    delete(id){
      return request({
        url: `${api_name}/delete?id=`+id,
        method: 'get'
      }) 
    }
}